﻿@model HomeCareLibrary.Models.HomeNumberModel
<div class="col-lg-9 col-sm-9 right_part">
          <div class="updatepage personalization-page">
            <div class="title clearfix">
              <h1>personalization</h1>
              <div class="top-btn-per clearfix">
                <div class="back-button"><a href="#"><img class="back-btn" src="/images/personalization-images/back-btn.png" alt="back-btn">
                <img class="back-mob-btn" src="/images/personalization-images/back-mob-btn.png" alt="back-mob-btn">
                </a></div>
              </div>
            </div>
            <div class="main-content">
              <div class="personalization-content">
                <div class="personalization-bg">
                  <div class="personalization-inn">
                   
                          @using (Html.BeginForm("UpdateHomeNumber", "Personalization", FormMethod.Post, new { id = "PersonalizationUpdateForm" }))

{
 @Html.HiddenFor(m => m.ID)
                          <div class="personalization-data update-per-data" >
                            <h3 class="personalization-heading">Update Your Personalization</h3>
                            <p class="top-data">To be better match home care program to your particular goals and situation,<br>
                              you can update your personalization.</p>
                              
                              
                               @if (ViewBag.getHome != null)
                               {
                              <br>
                               <p class="text-center"><strong>Select the home that you want to update:</strong></p>
                             
                            <div class="Dwelling-part update-form">
                              <div class="form-per">
                                <form role="form">
                                  <div class="form-group">
                                      
                                    
                                      @Html.DropDownList("getHome", null, new { @class = "form-control" })
                                     
                                  </div>
                                  
                                </form>
                              </div>
                            </div> <br>
                                }
                            <div class="button">
                             @* <button class="btn-per" type="button" id="btnupdatePersonalization1">Begin</button>*@
                                 <input type="submit" value="Begin" class="btn-per" id="btnupdatePersonalization"/>
                            </div>
                          </div>
                          }
                  </div>
                </div>
              </div>
            </div>
          </div>
          </div>

<script type="text/javascript">

    $(document).ready(function () {
        var homenumber = 0;

        var checkgethome = $("#getHome").val();
        if (checkgethome == undefined) {
            $("ID").attr('value','@ViewBag.getSingleHome');
        }
        else {
            $("#ID").attr('value',checkgethome);
            
        }
    });

    $('#getHome').change(function () {
        var getValue = $("#getHome option:selected").val();
        $("#ID").attr('value', getValue);
    });


   @* $("#btnupdatePersonalization").click(function () {
        //check if checkbox is checked the redirect to next page.
        var homenumber = 0;

        var checkgethome = $("#getHome").val();
        if (checkgethome == undefined) {
           
            homenumber = '@ViewBag.getSingleHome';
        }
        else {
            homenumber = $("#getHome").val();
        }

        url = "@(Url.Action("Index","Personalization", new { id="replace"}))";
        url = url.replace("replace", homenumber);
        window.location.href = url;
      
    });*@
   

</script>